package com.yunhe.authority.domain.authority;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yunhe.common.annotation.EnumItemCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;

import java.io.Serializable;
import java.util.List;

/**
 * @author zhengbo
 * @date 2021/10/21 14:24
 */

@ApiModel(value = "BackUser", description = "后台用户对象")
@NodeEntity
@Data
public class BackUser implements Comparable<BackUser>, Serializable {

    @ApiModelProperty(value = "用户ID")
    @Id
    @GeneratedValue
    private Long id;

    @ApiModelProperty(value = "用户名")
    private String name;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "名称")
    private String title;

    @ApiModelProperty(value = "电话")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    private String mail;

    @Relationship(type = "HAS_ROLE")
    private List<Role> role;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty(value = "性别")
    @EnumItemCode(code = "sex",fieldTitle = "sex")
    private String sexTitle;

    @ApiModelProperty(value = "归属组织id")
    private String ascriptionOrgId;

    @ApiModelProperty(value = "归属组织Title")
    private String ascriptionOrgTitle;

    @ApiModelProperty(value = "最后登录系统时间")
    private String lastLoginTime;

    @ApiModelProperty(value = "更新时间")
    private String updateTime;

    @ApiModelProperty(value = "新增时间")
    private String createTime;

    @ApiModelProperty(value = "排序序号")
    @JsonIgnore
    private String sn;

    @ApiModelProperty(value = "创建人")
    private String creator;

    @ApiModelProperty(value = "照片")
    private String photoUrl;

    @Override
    public int compareTo(BackUser o) {
        return 0;
    }
}
